package com.service.impl;

import com.bean.Cinema;
import com.dao.CinemaMapper;
import com.service.CinemaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 影院业务逻辑实现
 */
@Service
public class CinemaServiceImpl implements CinemaService {

    @Autowired
    private CinemaMapper cinemaMapper;

    @Override
    public int save(Cinema cinema) {
        return cinemaMapper.insert(cinema);
    }

    @Override
    public int remove(Cinema cinema) {
        return cinemaMapper.delete(cinema);
    }

    @Override
    public int modify(Cinema cinema) {
        return cinemaMapper.update(cinema);
    }

    @Override
    public List<Cinema> find(Cinema cinema) {
        return cinemaMapper.select(cinema);
    }

    @Override
    public int count(Map<String, Object> map) {
        return cinemaMapper.selectCount(map);
    }

    @Override
    public List<Cinema> query(Map<String, Object> map) {
        return cinemaMapper.selectByPage(map);
    }
}
